package Iterator_Pattern.Ye;

import java.util.List;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class YeIterator implements AbstractIterator {
    private List<Object> ye;
    private int cursor1;
    public YeIterator(YeList list){
        this.ye=list.getObjects();
        cursor1=0;
    }
    public Object ye(int num) {
        cursor1=0;
        int a=1;
        while (cursor1<ye.size()){
            System.out.println("********第"+a+"页********");
            for(int i=0;i<num;i++){
                if(cursor1<ye.size()) {
                    System.out.println(ye.get(cursor1));
                    cursor1++;
                }
                else{
                    cursor1++;
                }
            }
            a++;
        }
        return null;
    }
}
